package cn.wolfcode.domain;

import com.alibaba.fastjson.JSON;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;

public class CourseOrder {
    private Long id;

    private Date inputTime;

    private Customer customer;

    private SystemDictionaryItem course;

    private BigDecimal money;

    public String getJson(){
        HashMap map = new HashMap<>();
        map.put("id",id);
        map.put("money",money);
        if(course!=null){
            map.put("courseId",course.getId());
        }
        if(customer!=null){
            map.put("customerId",customer.getId());
            map.put("customerName",customer.getName());
        }
        return JSON.toJSONString(map);
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getInputTime() {
        return inputTime;
    }

    public void setInputTime(Date inputTime) {
        this.inputTime = inputTime;
    }

    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    public SystemDictionaryItem getCourse() {
        return course;
    }

    public void setCourse(SystemDictionaryItem course) {
        this.course = course;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }
}